import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import('../views/Home.vue'),
    children: [
      {
        path: '/login',
        name: 'Login',
        component: () => import('../views/login'),
        meta: { title: '登录', isNav: false }
      },
      {
        path: '/errbook',
        name: 'errbook',
        component: () => import('../views/errbook'),
        meta: { title: '错题本' }
      },
      {
        path: '/train',
        name: 'train',
        component: () => import('../views/train'),
        meta: { title: '智能训练' }
      },
      {
        path: '/testpaper',
        name: 'testpaper',
        component: () => import('../views/testpaper'),
        meta: { title: '试卷中心' }
      },
      {
        path: '/',
        name: 'welcome',
        component: () => import('../views/welcome'),
        meta: { title: '首页' }
      },
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
